﻿using CatUtils.Utils.Currency;
using CatUtils.Utils.Helper;
using CatUtils.Utils.SpecialUtils.PicBed.Sina;
using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

namespace CatUtils.Utils.SpecialUtils.PicBed.Smms
{
    public class PixivLoginStaticvalue
    { /// <summary>
      /// 强制解除证书验证。
      /// </summary>
        public static void InitSecurity()
        {
            System.Net.ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidate;
        }

        public static bool RemoteCertificateValidate(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
        {
            PrintLog.Log("警告！为了通过证书验证，总是返回true");

            return true;
        }

        /// <summary>
        /// 文件上传异常状态码
        /// </summary>
        public static class ErrorCode
        {
            /// <summary>
            /// 文件为空时触发
            /// </summary>
            public static readonly string FileEmpty = "FileEmpty";
        }

        /// <summary>
        /// 保证程序只打开一个新登录窗口
        /// </summary>
        public static bool LoginFormFlag = false;

        public static string UserFilePath { get; set; } = StaticValue.TempPath + "SinaUser.txt";
        public static string SinaUerModeText { get; set; } = "<username>{0}</username><userpass>{1}</userpass>";

        /// <summary>
        /// cookies 文件存储路径
        /// </summary>
        public static string CookiesFile { get; set; } = StaticValue.BinPath + "SinaCookies.txt";

        /// <summary>
        /// 如果页面加载失败，重新加载需要的时间。
        /// </summary>
        public static int ReloadSleepTime = 0;
    }
}